package com.techysky.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import com.techysky.entity.Paper;
import com.techysky.service.PaperManagerService;


@Controller
@RequestMapping("/exam")
public class ExamController {

	
	@Autowired
	private PaperManagerService paperManagerService;

	/**
	 * 首页
	 * 
	 * @param page
	 * @return
	 */
	@RequestMapping("/index")
	public String index(String exam,Model model) {
		if(!ObjectUtils.isEmpty(exam))
			model.addAttribute("initPage", exam);
		else
			model.addAttribute("initPage", "");
		return "exam";
	}
	
	
	
	@RequestMapping("/paper/delete")
	public String  saveOrUpdate(Paper paper){
		return this.paperManagerService.saveOrUpadte(paper);
	}
	
  
}
